package com.ruoyi.guarantee.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.guarantee.mapper.ItemGuaranteeConfigMapper;
import com.ruoyi.guarantee.domain.ItemGuaranteeConfig;
import com.ruoyi.guarantee.service.IItemGuaranteeConfigService;

/**
 * 服务保证配置Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-07
 */
@Service
public class ItemGuaranteeConfigServiceImpl implements IItemGuaranteeConfigService 
{
    @Autowired
    private ItemGuaranteeConfigMapper itemGuaranteeConfigMapper;

    /**
     * 查询服务保证配置
     * 
     * @param id 服务保证配置主键
     * @return 服务保证配置
     */
    @Override
    public ItemGuaranteeConfig selectItemGuaranteeConfigById(Long id)
    {
        return itemGuaranteeConfigMapper.selectItemGuaranteeConfigById(id);
    }

    /**
     * 查询服务保证配置列表
     * 
     * @param itemGuaranteeConfig 服务保证配置
     * @return 服务保证配置
     */
    @Override
    public List<ItemGuaranteeConfig> selectItemGuaranteeConfigList(ItemGuaranteeConfig itemGuaranteeConfig)
    {
        return itemGuaranteeConfigMapper.selectItemGuaranteeConfigList(itemGuaranteeConfig);
    }

    /**
     * 新增服务保证配置
     * 
     * @param itemGuaranteeConfig 服务保证配置
     * @return 结果
     */
    @Override
    public int insertItemGuaranteeConfig(ItemGuaranteeConfig itemGuaranteeConfig)
    {
        itemGuaranteeConfig.setCreateTime(DateUtils.getNowDate());
        return itemGuaranteeConfigMapper.insertItemGuaranteeConfig(itemGuaranteeConfig);
    }

    /**
     * 修改服务保证配置
     * 
     * @param itemGuaranteeConfig 服务保证配置
     * @return 结果
     */
    @Override
    public int updateItemGuaranteeConfig(ItemGuaranteeConfig itemGuaranteeConfig)
    {
        itemGuaranteeConfig.setUpdateTime(DateUtils.getNowDate());
        return itemGuaranteeConfigMapper.updateItemGuaranteeConfig(itemGuaranteeConfig);
    }

    /**
     * 批量删除服务保证配置
     * 
     * @param ids 需要删除的服务保证配置主键
     * @return 结果
     */
    @Override
    public int deleteItemGuaranteeConfigByIds(Long[] ids)
    {
        return itemGuaranteeConfigMapper.deleteItemGuaranteeConfigByIds(ids);
    }

    /**
     * 删除服务保证配置信息
     * 
     * @param id 服务保证配置主键
     * @return 结果
     */
    @Override
    public int deleteItemGuaranteeConfigById(Long id)
    {
        return itemGuaranteeConfigMapper.deleteItemGuaranteeConfigById(id);
    }
}
